/**
 * GetSet - defines getter/setter methods for property
 * @param getMethod Function, must return _property value
 * @param setMethod Fuunction, must declare 1 argument
 *
 * Usage:
 *     temp : GetSet(
 *              function() {
 *                  return _temp;
 *              },
 *              function(val) {
 *                  _temp = val;
 *              });
 */
window.GetSet = function(getMethod, setMethod) {
    return { typeOf : "getset", methods : {get : getMethod, set: setMethod} };
}

/**
 * Get - defines getter method for property
 * @param getMethod Function, must return _property value
 *
 * Usage:
 *     temp : Get(function() {
 *                  return _temp;
 *              });
 */
window.Get = function(getMethod) {
    return GetSet(getMethod, function() { throw new Error("Property is Read-Only"); });
}

/**
 * Set - defines setter method for property
 * @param setMethod Function, must declare 1 argument
 *
 * Usage:
 *     temp : Get(function(val) {
 *                 _temp = val;
 *              });
 */
window.Set = function(setMethod) {
    return GetSet(function() { return undefined; }, setMethod);
}

/**
 * Overload
 * @param function(s) 
 *
 * Usage:
 *     temp : Overload(function(val) {...},function(val, val) {...}, function() {...})
 */
window.Overload = function() {
     var obj = { typeOf : "overload", methods : {} };
     for(var i = 0; i < arguments.length; i++) {
         obj.methods[arguments[i].length.toString()] = arguments[i];
     }
     return obj;
}

/**
 * Static
 * @param object
 *
 * Usage:
 *     temp : Static('some text')
 *         or
 *     Static : {
 *         temp : 'some_text',
 *         other_var : 'some_other_text'
  *    }
 */
window.Static = function(obj) {
    return { typeOf : "static", object : obj };
}

window.Silent = function(object) { if (typeof eval(object) !== 'undefined') return eval(object); }